import javax.swing.JButton;
import javax.swing.JFrame;
import java.awt.BorderLayout;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class Menu extends JFrame implements ActionListener{
    public static void main(String[] args) {
        Menu mb = new Menu();
    }
	private JButton jb;
	public Menu()
    {
		JFrame frm = new JFrame("词频统计");
        // 创建布局管理器实例border，水平间隔为5，垂直间隔为7,
        BorderLayout border = new BorderLayout(8, 0);
        // 设置frm的页面布局为border
        frm.setLayout(border);
        frm.setSize(300, 100);
        JButton b1 = new JButton("开始游戏");
        JButton b2 = new JButton("游戏菜单");
		
        frm.add(b1, BorderLayout.NORTH);
        frm.add(b2, BorderLayout.SOUTH);
		b1.addActionListener(this);//加入事件监听
        frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frm.setVisible(true);
        
    }
    public void actionPerformed(ActionEvent e) {
            this.dispose();
            new Frm();
    }
}